﻿@model BcdFileListViewModel
@{
    Layout = null;
    ViewBag.Title = "案卷资料查看-文件列表";
}
@using (Html.BeginForm("VolumeListSplitPage", "FileCheck", null, FormMethod.Post, new { id = "pagerForm", name = "pagerForm_volume", onsubmit = "return divSearch(this, 'jgzl_wj_list');" }))
{
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
    <input type="hidden" name="ProId" value="@(ViewBag.ProId)" />
    <input type="hidden" name="FId" value="@(ViewBag.FId)" />
    
    <ul class="searchBar">
        <li><span>文件编号：</span>
            <input type="text" name="iput_code" value="@(ViewBag.iput_code)" />
        </li>
        <li><span>文件材料题名：</span>
            <input type="text" name="iput_name" value="@(ViewBag.iput_name)" />
        </li>
        <li>
            <button type="submit" class="btn btn-success btn-xs">
                搜索</button>
        </li>
    </ul>
   
}
<div class="panelBar" style="border-top: none;">
    <ul class="toolBar">
        <li>
            @Html.PermissionButton("CompletionMaterials.FileCheck.VolumeDetail", "CompletionMaterials_FileCheck_VolumeDetail",
                            Url.Action("VolumeDetail", "FileCheck", new { id = "{ids}" }), "查看",
                            new Dictionary<string, object>{
                             {"class","detail"},{"mask","true"},{"target","dialog"},{"width","550"},{"height","350"},{"warn","请选择一条信息!"}
                            })
        </li>
    </ul>
</div>
<table class="table" width="100%" layouth="150" nowraptd="false" rel="jgzl_wj_list">
    <thead>
        <tr align="center">
            <th width="35">序号</th>
            <th width="120">文件编号</th>
            <th>文件材料题名</th>
            <th width="150">责任者</th>
            <th width="120">日期</th>
            <th width="35">页数</th>
            <th width="100">附件</th>
            <th width="80">状态</th>
        </tr>
    </thead>
    <tbody>
        @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
        @foreach (var item in Model.TheBcdVolumedirectoryList)
        {
            num += 1;
            string state = "";
            string title = "";
            switch (item.Vd_State)
            {
                case 0:
                    state = "未审核";
                    break;
                case 1:
                    state = "审核通过";
                    break;
                case 2:
                    state = "已归档";
                    title = "档案号：" + item.Fl_Code + "-" + item.Fl_Numb.ToString("D3");
                    break;
                default:
                    break;
            }
            <tr target="ids" rel="@item.Vd_ID" align="center" data-state="@item.Vd_State" data-sole="VolumedirectoryList" title="@(title)">
                <td>@(num)</td>
                <td>@(item.Vd_Code)</td>
                <td><a style="color:#000" href="@Url.Action("VolumeDetail", "FileCheck", new { id = item.Vd_ID })" mask="true" target="dialog" width="550" height="330" title="查看文件">@(item.Vd_Name)</a></td>
                <td>@(item.Vd_Duty)</td>
                <td>@(item.Vd_Date == null ? "" : Convert.ToDateTime(item.Vd_Date).ToString("yyyy-MM-dd"))</td>
                <td>@(item.Vd_PageNumb)</td>
                <td><button id="dialogBtn_@num" type="button" onclick="openAttachFileDialog('@item.FilePath')">附件(@item.FileCount)</button></td>
                <td>@(state)</td>
            </tr>
        }
    </tbody>
</table>
<div class="panelBar" style="border-bottom: none;">
    <div class="pages" style="float: right">
        <span>显示</span>
        <select class="comsplitpage" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value},'jgzl_wj_list')">
            <option value="10" @(ViewBag.numPerPage == 10 ? "selected='selected'" : "")>10</option>
            <option value="20" @(ViewBag.numPerPage == 20 ? "selected='selected'" : "")>20</option>
            <option value="50" @(ViewBag.numPerPage == 50 ? "selected='selected'" : "")>50</option>
        </select>
        <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
    </div>
    <div class="pagination" style="margin:0px;float:left; margin-left:35%" rel="jgzl_wj_list" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)">
    </div>
</div>
<div id="dialog_file_12">
    <iframe id="myIframe_12" src="" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"
            style="height:400px; width:1150px;"></iframe>
</div>
<script>
    var attachFilePath_2;
    $("#dialog_file_12").dialog({
        title: "附件管理",
        autoOpen: false,
        modal: true,
        width: 1200,
        height: 450,
        open: function (ev, ui) {
            $('#myIframe_12').attr('src', attachFilePath_2);
        }
    });

    function openAttachFileDialog(filePath) {
        attachFilePath_2 = 'CompletionMaterials/FileManager/Index?filePath=' + filePath;
        $('#dialog_file_12').dialog('open');
    }
</script>
